﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using App.Core.Extensions;
using App.Domain;
using App.Web.ViewModels;
using App.Web.Utility;
using AutoMapper;

namespace App.Web.Areas.Private.Controllers
{
    [Authorize(Roles = "Site User")]
    public class WishlistController : BaseController
    {
		private AppEntities _Context = new AppEntities();
        
		#region Constructors
		public WishlistController()
		{
		}

		public WishlistController(UserViewModel currentUser)
			: base(currentUser)
        {
        }
		#endregion Constructors

		#region Action Methods
        public ActionResult Add(int id)
        {
            return View();
        }
        //public ActionResult Index()
        //{
        //    return View();
        //}
        ///// <summary>
        ///// Gets a Wishlist from Database to edit
        ///// </summary>
        ///// <param name="id"></param>
        ///// <returns></returns>
        //public ActionResult Edit(int id = 0)
        //{
        //    Wishlist entity = id == 0 ? new Wishlist() : _Context.Wishlists.FirstOrDefault(P => P.ID == id);            
        //    WishlistViewModel viewModel = Mapper.Map<Wishlist, WishlistViewModel>(entity);             
        //    return View(viewModel);
        //}

        ///// <summary>
        ///// Saves Wishlist Information into the Database
        ///// </summary>
        ///// <param name="viewModel"></param>
        ///// <returns></returns>
        //[HttpPost]
        //public ActionResult Edit(WishlistViewModel viewModel)
        //{
        //    if (!ModelState.IsValid)
        //        return View(viewModel);

        //    Wishlist entity = null; 
        //    if (viewModel.ID == 0)
        //    {
        //        entity = new Wishlist();
        //        _Context.AddToWishlists(entity);
        //    }
        //    else
        //        entity = _Context.Wishlists.FirstOrDefault(P => P.ID == viewModel.ID);

        //    entity = Mapper.Map<WishlistViewModel, Wishlist>(viewModel, entity);
        //    _Context.SaveChanges();
        //    return RedirectToAction("Index");        
        //}		
        #endregion Action Methods
		
		#region Helper Methods

        #endregion			
    }
}
